import os
from datetime import timedelta


# MYSQL 相关配置
SQLALCHEMY_DATABASE_URI = "mysql+pymysql://root:root@127.0.0.1:3306/acm?charset=utf8"
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
SQLALCHEMY_ECHO = True
SECRET_KEY = os.urandom(24)  # 设置为24位的字符,每次运行服务器都是不同的，所以服务器启动一次上次的session就清除
SQLALCHEMY_POOL_RECYCLE = 60
PERMANENT_SESSION_LIFETIME = timedelta(days=7)

# OJ URL
oj_url = "http://120.27.251.44:8080/zjgsu-python-platform/api/"
# data store target path
TARGET_PATH = os.path.relpath("ACM/data")
# allow file format
ALLOWED_EXTENSIONS = {'txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif', 'in', 'out'}
